<template>
	<view>
	      <view class="uni-list" >
	          <block v-for="(item,index) in res" :key="index">
	              <view class="uni-list-cell" hover-class="uni-list-cell-hover" @click="toyhqid(item.id)">
	                  <view class="uni-triplex-row">
	                      <view class="uni-triplex-left">
	                          <text class="uni-title uni-ellipsis" 
															style="font-size: 28upx;padding: 0;">参与人数: {{item.count_user}}</text>
	                          <text class="uni-text" style="font-size: 24upx;">{{item.time}}</text>
	                      </view>
	                      <view class="uni-triplex-right" style="width: 350upx;">
	                          <view class="status" style="background: #04ab02;">分红金额:{{item.total_money}}</view>
														<view v-if="item.common !=0" class="status" style="background: #f00;margin-top: 0;">{{item.common}}</view>
	                      </view>
	                  </view>
	              </view>
	          </block>
	      </view>
		<view v-if="res.length == 0" style="padding-top: 300upx;">
			<image src="../../static/searchlist.png" mode="" style="display: block;margin: 0 auto;width: 240upx;height: 240upx;"></image>
			<view style="text-align: center;color: #999;">暂时没有任何记录</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				openid:'',
				res:{},
			}
		},
		onLoad:function(){
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.setAjax()
				},
				fail: () => {
					uni.navigateTo({
						url: '/pages/login/login'
					});
				}
			});
		},
		methods: {
			setAjax(){
				var data = {
				    // 'openid':this.openid,
				   }
				uni.request({
					url: 'http://m.wpweipin.com/app/index.php?i=4&c=entry&m=ewei_shopv2&do=mobile&r=order.luckdraw.jiesuan&app=1',
					method: 'POST',
					data: data,
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success: res => {
						console.log(res)
						this.res = res.data.list
					},
					fail: () => {},
					complete: () => {}
				});
			},
			toyhqid(id){
				console.log(id)
				uni.navigateTo({
					url:'../yhqid/yhqid?id='+id
				})
			},
		}
	}
</script>


<style>.status{width:100%;font-size:24upx;background:#e0e0e0;text-align:center;color:#fff;margin-top:21upx;}</style>
